home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F47052_xsSortAdvanced.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-07-22  |  823 b   |  25 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.   <xsl:output method="text"/>
  3.   <xsl:template match="/">
  4.     <xsl:for-each select="root/line/word[not(@type = 'end')]">
  5.       <xsl:sort 
  6.         select="translate(concat(.,self::*[contains(.,'-')]
  7.                /following::word[@type='end']), '-', '')"/>
  8.       <xsl:choose>
  9.         <xsl:when test="contains(., '-')">
  10.           <xsl:value-of select="substring-before(., '-')"/>
  11.           <xsl:value-of select="following::word[@type='end']"/>
  12.         </xsl:when>
  13.         <xsl:otherwise>
  14.           <xsl:value-of select="."/>
  15.         </xsl:otherwise>
  16.       </xsl:choose>
  17.       <xsl:if test="position() != last()">
  18.         <xsl:text> </xsl:text>
  19.       </xsl:if>
  20.     </xsl:for-each>
  21.  </xsl:template>
  22. </xsl:stylesheet>
  23.  
  24.  
  25.